import request from '@/config/axios'

// 合作企业岗位 VO
export interface CompanyPostVO {
  id: number // 唯一ID
  companyId: number // 企业ID
  name: string // 岗位名称
}

// 合作企业岗位 API
export const CompanyPostApi = {
  // 查询合作企业岗位分页
  getCompanyPostPage: async (params: any) => {
    return await request.get({ url: `/dlbz/company-post/page`, params })
  },

  // 查询合作企业岗位详情
  getCompanyPost: async (id: number) => {
    return await request.get({ url: `/dlbz/company-post/get?id=` + id })
  },

  // 新增合作企业岗位
  createCompanyPost: async (data: CompanyPostVO) => {
    return await request.post({ url: `/dlbz/company-post/create`, data })
  },

  // 修改合作企业岗位
  updateCompanyPost: async (data: CompanyPostVO) => {
    return await request.put({ url: `/dlbz/company-post/update`, data })
  },

  // 删除合作企业岗位
  deleteCompanyPost: async (id: number) => {
    return await request.delete({ url: `/dlbz/company-post/delete?id=` + id })
  },

  // 导出合作企业岗位 Excel
  exportCompanyPost: async (params) => {
    return await request.download({ url: `/dlbz/company-post/export-excel`, params })
  }
}